import axios from 'axios'

// 设置请求接口的域名
axios.defaults.baseURL = 'http://121.89.213.194:5001'

// 获取轮播图
export const getBanner = () => {
  return axios.get('/banner')
}
// 获取歌单详情接口
export const getPlayList = (id) => {
  return axios.get('/playlist/detail', {
    params: { id }
  })
}
// 推荐歌单
export const getPersonalized = () => {
  return axios.get('/personalized')
}
// 热搜
export const getSearchHot = () => {
  return axios.get('/search/hot')
}
// 搜索建议
export const getSearchSuggest = (keywords) => {
  return axios.get('/search/suggest', {
    params: {
      keywords,
      type: 'mobile'
    }
  })
}
// 搜索结果
export const getSearchResult = (keywords) => {
  return axios.get('/search', {
    params: {
      keywords
    }
  })
}
